package com.menhai.personmanagement.controller;

import com.menhai.personmanagement.entity.Frontpage;
import com.menhai.personmanagement.services.IFrontpageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页 前端控制器
 * </p>
 *
 * @author shikun
 * @since 2021-12-01
 */

@Slf4j
@RestController
@RequestMapping("/frontpage")
public class FrontpageController {

     @Autowired
     private IFrontpageService frontpageService;

     /**
      * @describe 首页版1
      * @param
      * @Return java.util.List<com.menhai.personmanagement.entity.Frontpage>
      * @Date 2021/12/21 10:05
      * @author shikun
      */
     @RequestMapping("/selectListByOrder")
     public List<Frontpage> selectListByOrder(){
          return frontpageService.selectListByOrder();
     }

     /**
      * @describe
      * @param roleId
      * @Return java.util.List<com.menhai.personmanagement.entity.Frontpage>
      * @Date 2021/12/21 10:05
      * @author shikun
      */
     @RequestMapping("/selectBylevels")
     private String selectBylevels (@Param("roleId") String roleId,@Param("level") String level){
          return frontpageService.selectBylevels(roleId,level);
     }


     /**
      * @describe 首页版2
      * @param
      * @Return java.util.List<com.menhai.personmanagement.entity.Frontpage>
      * @Date 2021/12/28 10:03
      * @author shikun
      */
     @RequestMapping("/selectfixedpermissions")
     public List<Frontpage> selectfixedpermissions(@Param("roleId") String roleId){
          return frontpageService.selectfixedpermissions(roleId);
     }
}
